package com.itheima.mapper.system;

import com.itheima.domain.system.Syslog;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SyslogMapper {
    //查询所有
    @Select("select * from syslog")
    List<Syslog> findAll();

    //删除
    @Delete("delete from syslog where id=#{s}")
    void deleteById(String s);

    //模糊查询
    @Select("SELECT * FROM syslog WHERE username LIKE concat('%',#{name},'%')")
    List<Syslog> findLike(String name);

    //获取所有id
    @Select("select id from syslog")
    List<String> getId();

    //存日志信息
    @Insert("insert into syslog values(#{id},#{visitTime},#{username},#{ip},#{url},#{executionTime},#{method})")
    void setLog(Syslog syslog);
}
